#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
int n,m,k,T;
int cha[1000010] = {};
signed main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin >> T;
	while(T--) {
		vector<int> ans;
		vector<int> a,b;
		int ind = 0;
		priority_queue<int,vector<int>,greater<int> > q1;
		priority_queue<int,vector<int>,greater<int> > q2;
		cin >> n >> m;
		int bsum = 0;
		int asum = 0;
		for(int i = 0;i < n; ++ i) {
			int num = 0;
			cin >> num;
			a.push_back(num);
		}
		for(int i = 0;i < m; ++ i) {
			int num = 0;
			cin >> num;
			b.push_back(num);
			bsum += num;
		}
		bool flag = 0;
		sort(a.begin(),a.end());
		sort(b.begin(),b.end());
		b.push_back(b[m-1]);
		for(int i = n - m; i < n; ++ i) {
			asum += a[i];
			if(a[i] > b[i - (n - m)]) {
				// cerr << "ok2" << endl;
				cout << "-1" << endl;
				flag = 1;
				break;
			} 
			q2.push(a[i]);
		}
		if(flag) continue;
		if(bsum - asum > (n - m)) {
			// cerr << "ok1" << endl;
			cout << "-1"<<endl;
			continue;
		}
		for(int i = 0;i < n - m; ++ i) {
			q1.push(a[i]);
		}
		int cnt = 0;
		while(ind <= m) {
			// cerr << cnt << endl;
			while(!q2.empty() && q2.top() == b[ind] && ind < m) {
				ind ++;
				q2.pop();
			}
			if(q1.empty() && cnt < (n - m) - (bsum - asum)) {
				cout << "-1" << endl;
				flag = 1;
				break;
			}
            //cout<<ind<<" ";
			if(cnt >= (n - m) - (bsum - asum)) {
				//对后面处理
				if(q2.empty()) break;
				int num = q2.top();
				q2.pop();
				ans.push_back(num);
				q2.push(++num);
			}else {
				int num = q1.top();
                q1.pop();
				if(!q2.empty()){
					if(num == min(b[0],q2.top())) {
                        //cerr<<"ok"<<" "<<cnt;
						int u = q2.top();
                        q2.pop();
						q2.push(++u);
						ans.push_back(u-1);
						cnt--;
					}else {
						ans.push_back(num);
						q1.push(++num);
						q1.pop();
                        
					}
				}else {
                    //cerr<<num<<endl;
					if(num == b[0]) {
						cout << -1 << endl;
						flag = 1;
						break;
					} 
					else {
                        //cerr<<q1.top()<<endl;
						ans.push_back(num);
						q1.push(++num);
						q1.pop();
					}
				}
			}
			cnt++;
            //cerr<<q1.size()<<endl;
		}
		if(flag) continue;
		cout << n - m << endl;
		for(auto i : ans) cout << i << " ";
			if(n!=m) cout << endl;
	}
	return 0;
}